home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
432_01
/
ptmid3
/
ptmid.doc
< prev
next >
Wrap
Text File
|
1994-07-17
|
17KB
|
351 lines
NAME
ptmid - Creates Protracker MOD files or Multitracker MTM files
from General MIDI files (ver 0.3)
SYNOPSIS
ptmid [-cFile] [-dChannel] [-fFrac] [-q] [-s] infile[.mid]
[outfile[.mod]]
DESCRIPTION
Ptmid will take either standard MIDI format 0 or format 1 files and
convert them into various Tracker-type files. MIDI files are
industry standard, but need some sort of sequencer to be played, as
there can be near infinite simultaneous notes (though about 20 is a
standard maximum). Protracker files are 4 channel (though 6, 8, and
just about any other variety is supported) files, but have a bank
of digitized instruments included, so reasonable quality sound is
produced given limited hardware. Multitracker files are similar,
and support upto 32 simultaneous notes. Both Protracker and
Multitracker files are referred to as Tracker files in this
document.
The differences between MIDI (extension .mid) and Tracker
(extension .mod or .mtm) formats are more than superficial, and a
fair bit of information is needed to be able perform the conversion
- most of this is held in the configuration file: ptmid.cfg
The format of ptmid.cfg is fairly simple: Any line beginning with a
hash (#) is ignored, other lines contain configuration info. The
first word on a line (called a tag) specifies what sort of
information (and sometimes only one word is needed), anything
following this word is used as supplementary information and
depends of the sort of option specified by the first word.
One type of word needs a little explaining: pitch. A pitch, when
used in the configuration file, is a character string in the format
of: C2, C#2, D2, D#2, E2, F2, F#2, G2, G#2, A2, A#2, B2 (that was a
whole octave beginning with middle C). Other octaves can be used in
place of 2, eg. D#2, A-1, etc.
Here are a list of the tags permissible in the configuration file:
spath: The word following this tag is the name of the
directory that any subsequent samples will be found in. It
must end in a trailing slash, and be located in the file
before any line using the tags: def, xx, or dxx.
def, or xx (where xx is a number): These options supply
information on what samples (digitized instruments) should be
allocated to what MIDI instrument numbers. "def" is the
default non-percussion instrument, and must always be
specified. "xx" is a specific MIDI instrument. After the tag
are the filenames of the samples that can be used to represent
the instrument (if multiple filenames are used, then the one
sampled closest to the desired pitch for a note is chosen from
the list). If an allocation is not present for some particular
instrument, then the default instrument is used instead. A
shortcut is to put a quotes (") mark instead of a list of
filenames. This tells Ptmid that that instrument is identical
to the last one specified.
dxx (where xx is a number): This is similar to the above tag,
but applies to percussion samples. The first word following
the tag is the filename of the sample to associate with the
appropriate MIDI percussion instrument (only one filename can
be used). If there is another word following this, it is the
pitch to play the sample at when used in the Tracker file.
There is no default sample for non-specified percussion
instruments, as these are simply not played.
sample: The information following this tag tells Ptmid crucial
information about a sample. Samples can either be in .SMP
format (this is the default, and corresponds to headerless, 8
bit signed data), .WAV format, or .VOC format. The first word
following the tag is the filename of the sample which is to be
defined (and must correspond exactly to the filename of this
sample used elsewhere in the ptmid.cfg file). The next word is
the pitch of the sample when it's played (at 8287 Hz for .SMP
files, or the normal rate for .WAV or .VOC files). Optionally,
it can then be followed by a loop-start offset and a loop-
length (in that order), specified in words (1 word = 2 bytes).
After a sample is played it will stop if no loop information
is given, otherwise it will start looping at the loop-start
address and continue for the length of the loop-length
(looping continues indefinitely). A "sample" must be present
for EVERY filename given in one of the above options (def, xx,
or dxx).
drumch: The percussion channel is assumed to be 10, but some
MIDI devices assume it is elsewhere, and so Ptmid must know
what channel it will be to perform a correct conversion.
Following the tag name is a number which is the percussion
channel. Common values are 10 and 16.
fract: Ptmid quantizes (that is, groups notes to the closest
note) MIDI files duration conversion, and so must know what
the smallest type of note is. Following the tag name is a
number (possibly with a suffix of "t") which represents a type
of note - this is the quantize fraction. Valid fractions are
of the form: 4, 4t, 8, 8t, 16, 16t, etc. where 4 means a
quarter note (crotchet), 4t means a triplet, 8 means an
eighth-note (quaver), 8t means quaver-triplets, etc. It
usually can't hurt to give a smaller note (larger value),
though it uses up more memory, but the critical part is
knowing if a triplet note is needed. If not specified, the
fraction is assumed to be 16. This option can be overridden
with the similar option specified on the command line.
modfmt: This tag chooses the type of Tracker file to produce.
If the word following the tag name is "1", then Protracker
.mod files are produced (this is the default). If the word is
"2", then Multitracker .mtm files are produced.
maxchan: Following this tag is a number representing the
number of channels to have in the final Tracker file. It will
default to 4, and can have values upto 32. If creating a
Protracker file, putting values other than 4 may result in a
.mod file that cannot be played by your Tracker program,
although 6 and 8 are common too.
extend: If this tag is present, then an extended range of
notes is allowed during conversion. Usually there is a 3
octave range, but since MIDI allows a 9 octave range
converted files can sound wrong. With an extended range, 5
octaves are supported, but you need special trackers for this
(the tracker DMP is one example). The best solution for this
problem is to use multiple samples, each of which is digitized
an octave apart, and specify all of them for an instrument.
rgmode: There are 3 things Ptmid can do if despite using
"extend", a note is out-of-range. These things can be chosen
by specifying a number following this tag:
0 - This rounds a note to the nearest pitch (the default)
1 - Drop the note altogether
2 - Transpose the note by octaves until it's in range
Mode number 2 sounds the best, but it can generate melodies
that don't sound like the original, and is not the default.
nocopy: This tag will stop copyrighted MIDI files being
converted if it is present. Since MIDI files support a
copyright notice as part of their official format, I thought
that this wo